package cn.yy.pojo;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Reposity entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "reposity", catalog = "phoneerp")
public class Reposity implements java.io.Serializable {

	// Fields

	private Integer reposityId;
	private Inmatirial inmatirial;
	private Year year;
	private Month month;
	private Outmatirial outmatirial;
	private Matirialtype matirialtype;
	private Double originalAmount;

	// Constructors

	/** default constructor */
	public Reposity() {
	}

	/** full constructor */
	public Reposity(Inmatirial inmatirial, Year year, Month month,
			Outmatirial outmatirial, Matirialtype matirialtype,
			Double originalAmount) {
		this.inmatirial = inmatirial;
		this.year = year;
		this.month = month;
		this.outmatirial = outmatirial;
		this.matirialtype = matirialtype;
		this.originalAmount = originalAmount;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "reposityId", unique = true, nullable = false)
	public Integer getReposityId() {
		return this.reposityId;
	}

	public void setReposityId(Integer reposityId) {
		this.reposityId = reposityId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "inmatirialId", nullable = false)
	public Inmatirial getInmatirial() {
		return this.inmatirial;
	}

	public void setInmatirial(Inmatirial inmatirial) {
		this.inmatirial = inmatirial;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "yearId", nullable = false)
	public Year getYear() {
		return this.year;
	}

	public void setYear(Year year) {
		this.year = year;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "monthId", nullable = false)
	public Month getMonth() {
		return this.month;
	}

	public void setMonth(Month month) {
		this.month = month;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "outmatirialId", nullable = false)
	public Outmatirial getOutmatirial() {
		return this.outmatirial;
	}

	public void setOutmatirial(Outmatirial outmatirial) {
		this.outmatirial = outmatirial;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "matirialTypeId", nullable = false)
	public Matirialtype getMatirialtype() {
		return this.matirialtype;
	}

	public void setMatirialtype(Matirialtype matirialtype) {
		this.matirialtype = matirialtype;
	}

	@Column(name = "originalAmount", nullable = false, precision = 22, scale = 0)
	public Double getOriginalAmount() {
		return this.originalAmount;
	}

	public void setOriginalAmount(Double originalAmount) {
		this.originalAmount = originalAmount;
	}

}